package com.union.wx.controller;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.union.config.Config;

@Controller
public class IndexController {

	/**
	 * 跳转到主页
	 * @return
	 */
	@GetMapping("/")
	public String index(){
		String pv = (String) Config.getValue("PAGEVIEW");
		if(StringUtils.isNotBlank(pv)){
			Config.setProperty("PAGEVIEW", (Integer.valueOf(pv).intValue() + 1) + "");
		}else{
			Config.setProperty("PAGEVIEW", "1");
		}
		return "main";
	}
	
	/**
	 * 跳转到页面2
	 * @return
	 */
	@GetMapping("/s_month")
	public String s_month(){
		return "s_month";
	}
	
	/**
	 * 跳转到页面3
	 * @return
	 */
	@GetMapping("/t_list")
	public String t_list(@RequestParam("moun")Integer moun,ModelMap map){
		map.put("moun", moun);
		return "t_list";
	}
}
